﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<title></title>
<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
<div class="box box-primary" id="more" style="width:110px;height:35px;background-color:#222c32;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#222c32;">
            <div class="box-body home-message" id="moreOp" >
            </div>
        </div>
	<section class="content-header">
		<h1>药品目录查看</h1>
		<ol class="breadcrumb">
			<li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
			<li class="active"><a href="#">基础库管理</a></li>
			<li class="active"><a href="#">药品目录查看</a></li>
		</ol>
	</section>
	<section class="content">
		<div class=" box box-success">
			<div class="box-body">
				<div class=" form-inline">
					<div class="form-group form-group-xs">
                        <label for="txtDrugName">药品目录编码：</label>
                        <input class="form-control" type="text" id="drugcatalogCode" name="drugcatalogCode" placeholder="药品目录编码" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">药品目录名称：</label>
                        <input class="form-control" type="text" id="drugcatalogName" name="drugcatalogName" placeholder="药品目录名称" />
                    </div>
                   <div class="input">
                       <div class="textalign1"><spring:message code="状态"/>：</div>
                       <div class="boxinput">
                           <select class="form-control" name="status" id="status">
                            <option value="">请选择</option>
                            <option value="1">启用</option>
                            <option value="0">停用</option>
                           </select>
                       </div>
                       <div class="textalign" >
                            <input id="selectCata" type="button" id="selectDicCompType" onclick="likeQuery();" class="btn btn-success btn-sm" value="<spring:message code="查询"/>">
                       </div> 
                   </div>
             </div>               
           </div>
        </div>
		<table class="jqgrid" id="gridlist"></table>
		<div id="gridpage"></div>
	    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
	 
        $(function () {//新增
       
            $("#gridlist").jqGrid({
                url: "getStdDrugcatalogData.html",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                height: 270,                   	
                colNames: ['药品目录id','药品目录编码','药品目录名称','启用时间', '停用时间','状态','属性','操作'],
                colModel: [
						{ name: 'drugcatalogId',hidden:true, width: "0%",align: 'center',sortable: false},		
						{ name: 'drugcatalogCode', width: "15%",align: 'center',sortable: false},
						{ name: 'drugcatalogName', width: "15%",align: 'left' ,sortable: false},
						{ name: 'startTime', width: "15%",align: 'center',sortable: false,
							formatter : function(val, opts, rowdata) {
								return new Date(val).format("yyyy-MM-dd hh:mm:ss");
							}
						},
						{ name: 'endTime', width: "15%", align: 'center',sortable: false,
							formatter : function(val, opts, rowdata) {
								return new Date(val).format("yyyy-MM-dd hh:mm:ss");
							}
						},
						{ name: 'status', width: "10%", align: 'center',sortable: false,
							formatter : function(val, opts, rowdata) {
								var temp='其他';
								if(val == 0){temp = '停用';}
								else if (val == 1){ temp = '启用'; }
								return temp;
							}
						},
						{ name: 'attribute', width: "10%", align: 'center',sortable: false,
							formatter : function(val, opts, rowdata) {
								var temp='其他';
								if(val == 0){temp = '国家';}
								else if (val == 1){ temp = '省增补'; }
								return temp;
							}
						},
						{ name: 'operate', width: "10%", align:"center",sortable: false,
							formatter : function(val, opts, rowdata) {
	                    		var str =  "";
	                    		str+="<a href='${ctx}/dispatchingDrugcatalog/toStdDrugcatalogDetailInfo.html?drugcatalogId="+rowdata.drugcatalogId+" '>详情</a>";
	                    		return str;
	                    	}
                    }
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                multiselect: true, //勾选框
                caption: "药品目录查看",
                jsonReader: {
                	repeatitems: false,
                	id: "compRegId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
        });
        
        function likeQuery(){
        	var drugcatalogCode  = $("#drugcatalogCode").val();
       	    var drugcatalogName = $("#drugcatalogName").val();
       	    var status = $("status").val();
	       	$("#gridlist").jqGrid('setGridParam', { 
	       		mtype:"post",
	       		postData:{
					"drugcatalogCode":drugcatalogCode,
					"drugcatalogName":drugcatalogName,
					"status":status
			    },
	       	    page: 1 
	       }).trigger("reloadGrid");
       }
        
        
    
    </script>
</body>
</html>